home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lantools
/
blueprnt
/
console.mod
< prev
next >
Wrap
Text File
|
1989-09-27
|
3KB
|
103 lines
;************************************************************
;* Console Output Module (CONSOLE.MOD) *
;* by Craig Chaiken *
;* January 28, 1988 *
;* *
;* Function: Controls All Console I/O *
;************************************************************
background db 0 ;Run In Background Mode when Byte > 0
escape proc near ;*** Exit to DOS if ESC Key is Sensed ***
cmp byte ptr cs:background,1
jz escap1
call esctst
jnz escap1
int 20h
escap1: ret
escape endp
esctst proc near ;*** Return Z Flag is ESC Key is Sensed ***
mov ah,1
int 16h
jz escts2
escts1: xor ah,ah
int 16h
cmp al,27
ret
escts2: xor al,al
cmp al,1
ret
esctst endp
cls proc near ;clear screen
push ax
push bx
mov ah,0fh
int 10h
mov ah,0
int 10h
pop bx
pop ax
ret
cls endp
charout proc near ;display character in al to console
cmp cs:background,1
jz charo1
push ax
push bx
mov ah,0eh
xor bx,bx
int 10h
pop bx
pop ax
charo1: ret
charout endp
decout proc near ;display decimal of unsigned integer in ax
push ax
push bx
push dx
push ax
mov al,':'
call charout
pop dx
mov bx,10000
call decou1
mov bx,1000
call decou1
mov bx,100
call decou1
mov bx,10
call decou1
mov bx,1
call decou1
pop dx
pop bx
pop ax
ret
decou1: mov ax,dx
xor dx,dx
div bx
add al,'0'
jmp charout
decout endp
messout proc near ;display message at DS:DI to console
push ax
push di
messo1: mov al,[di]
or al,al
jz messo2
call charout
inc di
jmp messo1
messo2: pop di
pop ax
ret
messout endp
;************************************************************
;* End of Console I/O Module *
;************************************************************